<template>
  <div class="Header">
    <span class="title">购物车</span>
    <div class="main">
      <el-button v-if="store.state.basket.selectNum != 0" type="danger" size="mini" round @click="deletes">删除({{ store.state.basket.selectNum }})</el-button>
    </div>
  </div>
</template>

<script setup>
import { useStore } from 'vuex'
let store = useStore()
function deletes() {
  var arr = store.state.basket.select.filter((item) => {
    if (item.select) {
      return false
    }
    return true
  })
  store.commit('filterBasketSelect', arr)
}
</script>

<style lang='less' scoped>
.title {
  line-height: 45px;
}
.main {
  float: right;
  height: 100%;
  line-height: 45px;
}
</style>
